Skip to content

Conversation

@MaxDesiatov
Copy link
Contributor

@MaxDesiatov MaxDesiatov commented Dec 2, 2025

The current description mistakenly specified that an address of a local value in some address space is returned. When testing this with Wasm runtimes that already implement this command, it can be observed that the value itself is returned. The value itself may be an address for languages that use shadow stack in Wasm linear memory, but the value of an arbitrary local does not always contain that address.

The current description mistakenly specified that an address of the local value in some address space is returned. When testing this with Wasm runtimes that already implement this command, it can be clearly seen that the value is returned. The value itself may be an address for languages that use shadow stack in Wasm linear memory, but the value of an arbitrary local does not always contain that address.
@llvmbot
Copy link
Member

llvmbot commented Dec 2, 2025

@llvm/pr-subscribers-lldb

Author: Max Desiatov (MaxDesiatov)

Changes

The current description mistakenly specified that an address of the local value in some address space is returned. When testing this with Wasm runtimes that already implement this command, it can be clearly seen that the value is returned. The value itself may be an address for languages that use shadow stack in Wasm linear memory, but the value of an arbitrary local does not always contain that address.


Full diff: https://github.com/llvm/llvm-project/pull/170393.diff

1 Files Affected:

  • (modified) lldb/docs/resources/lldbgdbremote.md (+1-1)
diff --git a/lldb/docs/resources/lldbgdbremote.md b/lldb/docs/resources/lldbgdbremote.md
index 36b95f1073ebc..80e76fed8c78b 100644
--- a/lldb/docs/resources/lldbgdbremote.md
+++ b/lldb/docs/resources/lldbgdbremote.md
@@ -2505,7 +2505,7 @@ variables.
 
 Get the value of a Wasm function argument or local variable for the given frame
 index at the given variable index. The indexes are encoded as base 10. The
-result is a hex-encoded address from where to read the value.
+result is a hex-encoded little-endian value of the local.
 
 
 ```

Copy link
Member

@JDevlieghere JDevlieghere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, it returns the value, not the address. The documentation for qWasmGlobal and qWasmStackValue is incorrect as well.

Copy link
Member

@JDevlieghere JDevlieghere left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for fixing this!

@JDevlieghere JDevlieghere merged commit 94c8940 into llvm:main Dec 3, 2025
11 checks passed
MaxDesiatov added a commit to swiftwasm/WasmKit that referenced this pull request Dec 3, 2025
This change fully implements `qWasmLocal` GDB RP host command per the LLDB extensions specification updated in llvm/llvm-project#170393.
kcloudy0717 pushed a commit to kcloudy0717/llvm-project that referenced this pull request Dec 4, 2025
The current description mistakenly specified that an address of a local
value in some address space is returned. When testing this with Wasm
runtimes that already implement this command, it can be observed that
the value itself is returned. The value itself may be an address for
languages that use shadow stack in Wasm linear memory, but the value of
an arbitrary local does not always contain that address.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants